{{Extend "layout"}}
{{Block "title"}}{{"FTP账号列表"|T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li class="active">{{"FTP账号列表"|T}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
				<div class="col-md-12">
					<div class="block-flat">
						<div class="header">
							<div class="pull-right" style="margin-left:10px">
								<form class="form-horizontal" action="" id="search-form" method="GET">
								<div class="input-group">
                					<span class="input-group-addon">{{"分组"|T}}</span>
									<select name="groupId" class="form-control" id="groupId" onchange="$('#search-form').submit()">
										<option value="0"> - {{"不限"|T}} - </option>
										{{$groupId := Stored.groupId}}
										{{range $k, $v := Stored.groupList}}
										<option value="{{$v.Id}}"{{if eq $groupId $v.Id}} selected{{end}}>{{$v.Name}}</option>
										{{end}}
									</select>
						  		</div>
								</form>
							</div>
							<a href="__BACKEND__/ftp/account_add" class="btn btn-success pull-right">
								<i class="fa fa-plus"></i>
								{{"添加FTP账号"|T}}
							</a>
							<h3>{{"FTP账号列表"|T}}</h3>
						</div>
						<div class="content">
							<div class="table-responsive">
							<table class="table no-border hover">
								<thead class="no-border">
									<tr>
										<th style="width:2%;"><strong>UID</strong></th>
										<th><strong>{{"账户名"|T}}</strong></th>
										<th style="width:15%;"><strong>{{"用户组"|T}}</strong></th>
										<th style="width:15%;"><strong>{{"授权目录"|T}}</strong></th>
										<th style="width:15%;"><strong>{{"创建时间"|T}}</strong></th>
										<th style="width:15%;"><strong>{{"更新时间"|T}}</strong></th>
										<th><strong>{{"状态"|T}}</strong></th>
										<th style="width:15%;" class="text-center"><strong>{{"操作"|T}}</strong></th>
									</tr>
								</thead>
								<tbody class="no-border-y">
                                    {{range $k,$v := Stored.listData}}
									<tr>
										<td>{{$v.Id}}</td>
										<td>{{$v.Username}}</td>
										<td>{{if $v.Group}}{{$v.Group.Name}}{{else}}{{"无"|T}}{{end}}</td>
										<td>{{$v.Directory}}</td>
										<td>{{(Date $v.Created).Format "2006-01-02 15:04:05"}}</td>
										<td>{{if gt $v.Updated 0}}{{(Date $v.Updated).Format "2006-01-02 15:04:05"}}{{end}}</td>
                                        {{if eq $v.Banned "Y"}}
										<td class="color-danger">{{"禁止连接"|T}}</td>
                                        {{else}}
                                        <td class="color-success">{{"允许连接"|T}}</td>
                                        {{end}}
										<td class="text-center">
										<a class="label label-default" href="__BACKEND__/ftp/account_add?copyId={{$v.Id}}" title="{{"复制"|T}}"><i class="fa fa-copy"></i></a>
										<a class="label label-success" href="__BACKEND__/ftp/account_edit?id={{$v.Id}}"><i class="fa fa-pencil"></i></a> 
										<a class="label label-danger" href="__BACKEND__/ftp/account_delete?id={{$v.Id}}" onclick="return confirm('{{"真的要删除吗？"|T}}');"><i class="fa fa-times"></i></a>
										</td>
									</tr>
                                    {{end}}
								</tbody>
							</table>		
							</div>
							{{Stored.pagination.Render}}
						</div>
					</div>				
				</div>
			</div>
{{/Block}}